package com.jinmdz.fmis.api.quartz;

import com.jinmdz.fmis.api.service.GlobalJobService;
import com.jinmdz.fmis.api.service.MySqlJobService;
import com.jinmdz.fmis.core.util.LogUtil;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.scheduling.quartz.QuartzJobBean;

import javax.annotation.Resource;

/**
 * @author LiCongLu
 * @date 2019-12-23 09:13
 */
public class GlobalJob extends QuartzJobBean {

    @Resource
    private GlobalJobService globalJobService;
    @Resource
    private MySqlJobService mySqlJobService;

    @Override
    protected void executeInternal(JobExecutionContext context) throws JobExecutionException {
        LogUtil.info("开启定时查询");
        globalJobService.executeInternal(context);
        mySqlJobService.executeInternal(context);
        LogUtil.info("结束定时查询");
    }
}